package com.kung.qvs.data.source.http.service;

import com.kung.qvs.entity.BaseResultBean;
import com.kung.qvs.entity.DemoEntity;
import com.kung.qvs.entity.GarbageTypeBean;
import com.kung.qvs.entity.KRecordWeight;
import com.kung.qvs.entity.ProductBean;
import com.kung.qvs.entity.ProductInfoBean;
import com.kung.qvs.entity.ProductTypeBean;
import com.kung.qvs.entity.PropInfoBean;
import com.kung.qvs.entity.ResSetInfoBean;
import com.kung.qvs.entity.StatisticsBean;
import com.kung.qvs.entity.WorkerBean;
import com.kung.qvs.utils.Constants;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import me.goldze.mvvmhabit.http.BaseResponse;
import me.goldze.mvvmhabit.http.BaseResponseBean;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Query;

/**
 * Created by goldze on 2017/6/15.
 */

public interface JtApiService {

//    Observable<ResponseBody> doSetPrintCertificate(@Body RequestBody body);

    @FormUrlEncoded
    @POST(Constants.reqSynchronizeProductTypes)
    Observable<BaseResultBean<List<ProductTypeBean>>> reqSynchronizeProductTypes(@Field("orgCode") String orgCode,
                                                                                 @Field("deviceCode") String deviceCode);

    @FormUrlEncoded
    @POST(Constants.reqSynchronizeProducts)
    Observable<BaseResultBean<List<ProductBean>>> reqSynchronizeProducts(@Field("orgCode") String orgCode,
                                                                         @Field("deviceCode") String deviceCode);

    @FormUrlEncoded
    @POST(Constants.reqAddProductBean)
    Observable<BaseResultBean<Integer>> reqAddProductBean(@Field("orgCode") String orgCode,
                                                          @Field("deviceCode") String deviceCode,
                                                          @Field("productCode") String productCode,
                                                          @Field("parentId") String parentId,
                                                          @Field("productName") String productName,
                                                          @Field("productWeight") String productWeight,
                                                          @Field("convertRate") String convertRate,
                                                          @Field("remark") String remark);

    @FormUrlEncoded
    @POST(Constants.reqUpdateProductBean)
    Observable<BaseResultBean<Integer>> reqUpdateProductBean(@Field("orgCode") String orgCode,
                                                             @Field("deviceCode") String deviceCode,
                                                             @Field("productCode") String productCode,
                                                             @Field("parentId") String parentId,
                                                             @Field("productName") String productName,
                                                             @Field("productWeight") String productWeight,
                                                             @Field("convertRate") String convertRate,
                                                             @Field("remark") String remark);

    @FormUrlEncoded
    @POST(Constants.reqDeleteProductBean)
    Observable<BaseResultBean<Integer>> reqDeleteProductBean(@Field("orgCode") String orgCode,
                                                             @Field("deviceCode") String deviceCode,
                                                             @Field("productCode") String productCode);

    @FormUrlEncoded
    @POST(Constants.reqSynchronizePackers)
    Observable<BaseResultBean<List<WorkerBean>>> reqSynchronizePackers(@Field("orgCode") String orgCode,
                                                                       @Field("deviceCode") String deviceCode,
                                                                       @Field("roleId") String roleId,
                                                                       @Field("userName") String userName);

    @FormUrlEncoded
    @POST(Constants.reqDeletePacker)
    Observable<BaseResultBean<Integer>> reqDeletePacker(@Field("orgCode") String orgCode,
                                                        @Field("deviceCode") String deviceCode,
                                                        @Field("userId") String userId);

    @FormUrlEncoded
    @POST(Constants.reqAddPacker)
    Observable<BaseResultBean<Integer>> reqAddPacker(@Field("orgCode") String orgCode,
                                                     @Field("deviceCode") String deviceCode,
                                                     @Field("userCode") String userCode,
                                                     @Field("userName") String userName);

    @FormUrlEncoded
    @POST(Constants.reqUpdatePacker)
    Observable<BaseResultBean<Integer>> reqUpdatePacker(@Field("orgCode") String orgCode,
                                                        @Field("deviceCode") String deviceCode,
                                                        @Field("userId") String userId,
                                                        @Field("userCode") String userCode,
                                                        @Field("userName") String userName);

    @FormUrlEncoded
    @POST(Constants.reqUploadWeightRecord)
    Observable<BaseResultBean<KRecordWeight>> reqUploadWeightRecord(@Field("orgCode") String orgCode,
                                                                    @Field("deviceCode") String deviceCode,
                                                                    @Field("productId") String productId,
                                                                    @Field("productName") String productName,
                                                                    @Field("standardWeight") String standardWeight,
                                                                    @Field("convertRate") String convertRate,
                                                                    @Field("packerId") String packerId,
                                                                    @Field("packerAccount") String packerAccount,
                                                                    @Field("packerName") String packerName,
                                                                    @Field("weight") String weight,
                                                                    @Field("amount") String amount,
                                                                    @Field("printCompany") String printCompany,
                                                                    @Field("isHang") String isHang);

    @FormUrlEncoded
    @POST(Constants.reqGetWeightRecord)
    Observable<BaseResultBean<List<KRecordWeight>>> reqGetWeightRecord(@Field("orgCode") String orgCode,
                                                                       @Field("deviceCode") String deviceCode,
                                                                       @Field("workerId") String workerId,
                                                                       @Field("beginTime") String beginTime,
                                                                       @Field("endTime") String endTime,
                                                                       @Field("pageSize") int pageSize,
                                                                       @Field("pageIndex") int pageIndex);

    @FormUrlEncoded
    @POST(Constants.reqGetWeightRecordStatistics)
    Observable<BaseResultBean<StatisticsBean>> reqGetWeightRecordStatistics(@Field("orgCode") String orgCode,
                                                                            @Field("deviceCode") String deviceCode);

    @FormUrlEncoded
    @POST(Constants.reqGetWeightRecordStatisticsDetail)
    Observable<BaseResultBean<List<KRecordWeight>>> reqGetWeightRecordStatisticsDetail(@Field("orgCode") String orgCode,
                                                                                        @Field("deviceCode") String deviceCode,
                                                                                        @Field("beginTime") String beginTime,
                                                                                        @Field("endTime") String endTime);
}
